UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pq3aQmm9eQ1oSsx0sosrmDHrqVoOHIluOinr1Hlrbo8='
WHERE
key_id = '69cdfea226191261e3e4edd0659c063ba9ee89ae07bf5dcc65cd2a60fc367d41'
AND (
token = 'Pq3aQmm9eQ1oSsx0sosrmDHrqVoOHIluOinr1Hlrbo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)