UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1AcMMWQggHbXeFmIieOZaql3t99kPllQ/6zVQmpOCNU=' 
WHERE 
  key_id = 'd17634b33483fe670312cdc5979e0f0755874a9818170bf81478163300d6e9ce' 
  AND (
    token = '1AcMMWQggHbXeFmIieOZaql3t99kPllQ/6zVQmpOCNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034