UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's+pspB89bEbepVIKjAgaKNeQQbHr/tZURBYLysAOUHM='
WHERE
key_id = 'ae8ddc82764db7ea7a64e86dab02467f55ad195bd3c1b2c4c017a15176f26b28'
AND (
token = 's+pspB89bEbepVIKjAgaKNeQQbHr/tZURBYLysAOUHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)