UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4g7l/WrUFdQmw7NQbYilDw6q6/s99I9Fx6KQ++ulhg=' 
WHERE 
  key_id = 'c63492eff17e8263b8e06c082f8f1047bf7c189b34ed526ad0e829aa00841bac' 
  AND (
    token = 'Q4g7l/WrUFdQmw7NQbYilDw6q6/s99I9Fx6KQ++ulhg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027