UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zbw8eDkqhYEFTQXlWR9Rk6AzQ+VTMrkE6vsIesXkKg4='
WHERE
key_id = 'e4c41e85e2423008c10143af68954715a7a34ef717617dc185dbf30c10a53cb3'
AND (
token = 'zbw8eDkqhYEFTQXlWR9Rk6AzQ+VTMrkE6vsIesXkKg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)