UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+onWhz3WwLavS1SBTxT0I3vcFN/GI38xVl+f7GIXHv0='
WHERE
key_id = 'e2cca367dd766cb2e80cc6b6182d9d04597a1fe1be8827ff68631cc197c09340'
AND (
token = '+onWhz3WwLavS1SBTxT0I3vcFN/GI38xVl+f7GIXHv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)