UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tWvgpNEbmJRL25bKyVjOJCdNRl03zmKGZMQKoaauSWQ=' 
WHERE 
  key_id = '795e06b067450c0af0831223aa932601ed36d2bb5a80a0bc3fb40fffc7ee1bd7' 
  AND (
    token = 'tWvgpNEbmJRL25bKyVjOJCdNRl03zmKGZMQKoaauSWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025