UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'solPbNwhzsRtQjrFG9WisUf7xBvnB0Jb2wVjk99aG1w='
WHERE
key_id = '83d35c5269b69da19408af3a5d31a0ccf1b82c3c159e459a520fe2dec5c86a41'
AND (
token = 'solPbNwhzsRtQjrFG9WisUf7xBvnB0Jb2wVjk99aG1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)