UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9o/Q++GtY8bVEBH/OVPmy1sZf+SDErgwI0TjJkl4wng=' 
WHERE 
  key_id = 'c8616adb263836f46d286a8d10306e763217f2e7b2e573719c8ad551167ca61f' 
  AND (
    token = '9o/Q++GtY8bVEBH/OVPmy1sZf+SDErgwI0TjJkl4wng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044