UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wFJ+PiGypQZDOEaRwyjLYEBw+NBOO9ISipeA7PuIfpY=' 
WHERE 
  key_id = 'f2520314f8c831fee40c7c896dae472b66110b7a4ad1afe13b2e7c53854248c2' 
  AND (
    token = 'wFJ+PiGypQZDOEaRwyjLYEBw+NBOO9ISipeA7PuIfpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029