UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11p+OiLdXYiicQV22uLc1otAbXRe/zRUuMgA4vvd8HI='
WHERE
key_id = 'a71f9177aa2061266c147fe4ac45daddbab9a1a1a5e67fe5c829d60f03a99a78'
AND (
token = '11p+OiLdXYiicQV22uLc1otAbXRe/zRUuMgA4vvd8HI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)