UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+0Av28xZZoSKnQefKnoALJKie5lLrLrPjngtEXqyd/I=' 
WHERE 
  key_id = 'd5932057774e548da791016b9734e6a3625f6f53f017766f26e542630ff74c2b' 
  AND (
    token = '+0Av28xZZoSKnQefKnoALJKie5lLrLrPjngtEXqyd/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047