UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QQdMbYKeBLxqhHw6lTFx6I+Py1EEbmz+5q32VCbtALQ='
WHERE
key_id = '3ed503abb73770e8c49b7559ad80e387b70523c5dbb696c49226a8c60532fd60'
AND (
token = 'QQdMbYKeBLxqhHw6lTFx6I+Py1EEbmz+5q32VCbtALQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)