UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V0ZpfaPagtZnIC5Dn7YOQnD2ghzmyGMcZSvj1K1w2nQ=' 
WHERE 
  key_id = '4c0bad61f4b7f5c724def3b56886cdffc8a4a6649ce6e0245c69cdd0288b4ee7' 
  AND (
    token = 'V0ZpfaPagtZnIC5Dn7YOQnD2ghzmyGMcZSvj1K1w2nQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025