UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sQLJY6WlRpRVmXs3KDViutU/fCYK6NnY8gLusZT7sJQ='
WHERE
key_id = 'ce24653e94a5fbce00b675c0ab462fdf2d9929724538b20f9fd69a38717abf6d'
AND (
token = 'sQLJY6WlRpRVmXs3KDViutU/fCYK6NnY8gLusZT7sJQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)