UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ViV+iz6f2UaOf48lvVYgZ0NWvCFK7oqYUoR/DMlUU80='
WHERE
key_id = 'a33e82fbfad061d98897d3a8b6f3a5d8d4eca65fa3751529a272ef180e6ab2a8'
AND (
token = 'ViV+iz6f2UaOf48lvVYgZ0NWvCFK7oqYUoR/DMlUU80='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)