UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yWl46Tht1QKaJNmHxdmYaVDzdks1TnOQ/M32PjN+jk4='
WHERE
key_id = '634718d0f7dbf80282a68e9dda23358e215157f93fe89842912c00274cfba5b7'
AND (
token = 'yWl46Tht1QKaJNmHxdmYaVDzdks1TnOQ/M32PjN+jk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)