UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y1b3uPc3izd7/sUZ2ElmfN9hZ08dPBuaYsdYOp07xI0=' 
WHERE 
  key_id = 'bfa0c06cc553bec67044de19160d1e379812590ed41d90cdc711d25059fb41ca' 
  AND (
    token = 'y1b3uPc3izd7/sUZ2ElmfN9hZ08dPBuaYsdYOp07xI0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033