UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qdU8ejbRD8AlKILT4xIv9VhQXYbLIAT/pC8o2o0VqCg=' 
WHERE 
  key_id = '6b79177bb2c798fc4ef23ecae706811f94f0e6dbac0f7bc0e0de157978db2891' 
  AND (
    token = 'qdU8ejbRD8AlKILT4xIv9VhQXYbLIAT/pC8o2o0VqCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046