UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lurPhgR/PhqmGQ6tCa8ibD0zn6g6Oi6sE0ESQ2r7yDg=' 
WHERE 
  key_id = '2fac33687f2fa2902668e074e94c900d327cfec4fbeae6679367f7b90835f795' 
  AND (
    token = 'lurPhgR/PhqmGQ6tCa8ibD0zn6g6Oi6sE0ESQ2r7yDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033