UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6+MuhIRRzstBFIN/LTKSUofCXaXk0E/I2K09TL3uVpc=' 
WHERE 
  key_id = 'e152fa2ac0e9c9175686179560d9c70cf851078de2068c8f5ef7d669bacede42' 
  AND (
    token = '6+MuhIRRzstBFIN/LTKSUofCXaXk0E/I2K09TL3uVpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018