UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bAOvbLQ+lebZpna7L5eSkP8ZTIE7/9ac8MJSvqDGS8='
WHERE
key_id = 'e5b2ff1a52c08901d034297300f0bf8a98ec0a912cf49f8d5f5e4d318a9e3464'
AND (
token = '1bAOvbLQ+lebZpna7L5eSkP8ZTIE7/9ac8MJSvqDGS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)