UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FadxyrfhXsDor35c/3701FQfP7OeSpqDOFutNlw+RIw='
WHERE
key_id = '36cfda350aa73cb88bcdcdaaf8850a6f6677566554e09072bd54512e01961b2e'
AND (
token = 'FadxyrfhXsDor35c/3701FQfP7OeSpqDOFutNlw+RIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)