UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xONMEKhV+GRgnBTD5wllPv2zPc+jEYhw0LYsX5s/G4A='
WHERE
key_id = '2485343b588eb16f29c586b0943ea413f328d3ef10cd5397597e7bbbf0405548'
AND (
token = 'xONMEKhV+GRgnBTD5wllPv2zPc+jEYhw0LYsX5s/G4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)