UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a6Wbsvs9Kyqa615HpqiwqQKXsl7jd5xmWK4cDPBpBgY=' 
WHERE 
  key_id = '36e493fc153e3337ae895a875be2969983740ad78337f7ad73dbce7a05c1431b' 
  AND (
    token = 'a6Wbsvs9Kyqa615HpqiwqQKXsl7jd5xmWK4cDPBpBgY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018