UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w352iH8FsK8d3AFol9VUkGXs/CwRugH4VQJPQBWBa2w='
WHERE
key_id = '781dcdf6361546edc44b049ab4e1b26ef517032a947c766f178eb464bfbeff0f'
AND (
token = 'w352iH8FsK8d3AFol9VUkGXs/CwRugH4VQJPQBWBa2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)