UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IIyrr033i2/82dUYjO+1S7n7wzNPpR3T2ZoFVlPCng4='
WHERE
key_id = 'de6f7b5383d57e4457f7cc2a635fcf5c1b3e906ef5f91b80f1b1bccc0571afbf'
AND (
token = 'IIyrr033i2/82dUYjO+1S7n7wzNPpR3T2ZoFVlPCng4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)