UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qDpDNwf25j/kaZAJ+m1AKnZmjnT1qFRf3ijHm/Mn588=' 
WHERE 
  key_id = 'c3b9eb93ce22971e5262eb160ef1e5027054a6b20ab1f0ac5d592df9de482bb3' 
  AND (
    token = 'qDpDNwf25j/kaZAJ+m1AKnZmjnT1qFRf3ijHm/Mn588=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025