UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5YXC8G9+LLkJQ1hV+hTXmYv7xxeRUv7H1cWPd3+Nl/Y='
WHERE
key_id = 'fe9a74e93f9b0526f1cf158e3a5b6d939733da6466618aa0b77f47dd21fa0cf4'
AND (
token = '5YXC8G9+LLkJQ1hV+hTXmYv7xxeRUv7H1cWPd3+Nl/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)