UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FI0bVmY7DpPcPy6UC7Mn725mp28YdykGKt0B3f89Mxg='
WHERE
key_id = 'ef35439d349b51a453b02cac56693c3ce8e696baa3131eac7f811beeefd2c289'
AND (
token = 'FI0bVmY7DpPcPy6UC7Mn725mp28YdykGKt0B3f89Mxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)