UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bFJUKPkkziUF8xeXtNX0/DWRx7XS4E7fxZr9tj4jA84='
WHERE
key_id = '1ccffc5e9fe3543539af8eb11b3638206df7ffe984b32d7f0c202d850f5dc677'
AND (
token = 'bFJUKPkkziUF8xeXtNX0/DWRx7XS4E7fxZr9tj4jA84='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)