UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yfq0GQ4cr4B8jAwIJqQ/HQHrpA0rCI8mca0NMoH5Qv8='
WHERE
key_id = '66dccd3374fcfc8cd1e635d02799a3b3f3f43b191782c6ac404e200df72f03b3'
AND (
token = 'yfq0GQ4cr4B8jAwIJqQ/HQHrpA0rCI8mca0NMoH5Qv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)