UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wUSpL72fjZ2b2bt8eaS1osmfrHZwoCNOq39J6oMLmNY='
WHERE
key_id = 'baea9f4e22f31cc599df0c00c4a239d722bdb78f6d3c993fbe14bec5159d0e3a'
AND (
token = 'wUSpL72fjZ2b2bt8eaS1osmfrHZwoCNOq39J6oMLmNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)